﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- saved from url=(0014)about:internet -->
<html>
<head>
<title>fake</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script>
var currentUrl;

function getCookie(cookie_name)
{
var allcookies = document.cookie;
var cookie_pos = allcookies.indexOf(cookie_name + "=");

if (cookie_pos != -1)
{
cookie_pos += cookie_name.length + 1;
var cookie_end = allcookies.indexOf(";", cookie_pos);

if (cookie_end == -1)
{
cookie_end = allcookies.length;
}
var value = unescape(allcookies.substring(cookie_pos, cookie_end));
}else{
var value = "";
}
return value;
}

function window_resize(){
if(navigator.userAgent.indexOf("iPad")>-1||navigator.userAgent.indexOf("iPhone")>-1||navigator.userAgent.indexOf("iPod")>-1||navigator.userAgent.indexOf("Android")>-1){
document.getElementById("Index").style.cssText = "height: auto;width: " + (window.innerWidth-20);
document.getElementById("currentTopic").style.cssText = "width: " + (window.innerWidth-20);
}else if(window.innerHeight){
document.getElementById("Index").style.cssText = "height: " + (window.innerHeight- 140) + "; width: " + (window.innerWidth-20);
document.getElementById("currentTopic").style.cssText = "width: " + (window.innerWidth-20);
}else{
document.getElementById("Index").style.cssText = "height: " + (document.body.offsetHeight - 130) + "; width: " + (document.body.offsetWidth - 20);
document.getElementById("currentTopic").style.cssText = "width: " + (document.body.offsetWidth - 20);
}
}


function window_load(){
	var i;
	var c = getCookie("Bookmarks");
	if(c!=''){
		var a = c.split("\n");
		for(i=0;i<=(a.length-1)/2;i++){
			document.getElementById("Index").options[document.getElementById("Index").options.length] = new Option(a[i*2],a[i*2+1]);
			if(i==0){
				document.getElementById("Index").selectedIndex = 0;
			}
		}
	}
	window_resize();
	window.setTimeout("syn();",300);
}

function keyword_change(k){
	var i;
	var str;
	var found = false;
	for(i=0;i<document.getElementById("Index").options.length;i++){
		 str = document.getElementById("Index").options[i].text;
		 if(str.indexOf(k.value) == 0 && found == false){
		 	document.getElementById("Index").options[i].selected = true;	
			found = true;
		 }
	}
}

function display_click(){
	var i;
	for(i=0;i<document.getElementById("Index").options.length;i++){
		 if(document.getElementById("Index").options[i].selected){
			parent.content.document.location.href = document.getElementById("Index").options[i].value;
			break;
		 }
	}
}

function savetocookie(){
	var i;
	var v = "";
	for(i=0;i<document.getElementById("Index").options.length;i++){
		if(v!=""){v = v + "\n"};
		 v = v + document.getElementById("Index").options[i].text + "\n" + document.getElementById("Index").options[i].value;
	}
	
	var expires = new Date();
	expires.setTime(expires.getTime() + 24 * 3600 * 365 * 10000);
	document.cookie = "Bookmarks=" + escape(v) + ";expires=" + expires.toGMTString();
}

function add_click(){
	document.getElementById("Index").options[document.getElementById("Index").options.length] = new Option(document.getElementById("currentTopic").value,currentUrl);	
	document.getElementById("Index").selectedIndex = document.getElementById("Index").options.length - 1;
	savetocookie();
}

function remove_click(){
	var i;
	for(i=0;i<document.getElementById("Index").options.length;i++){
		 if(document.getElementById("Index").options[i].selected){
			document.getElementById("Index").options[i] = null;
			if(document.getElementById("Index").options.length>0){
				if(i<=document.getElementById("Index").options.length -1){
					document.getElementById("Index").options[i].selected = true;
				}else{
					document.getElementById("Index").options[document.getElementById("Index").options.length -1].selected = true;
				}
			}
			
			break;
		 }
	}
	savetocookie();	
}

function syn(){
	if(parent.content.document.location.href!=currentUrl){
		document.getElementById("currentTopic").value = parent.content.document.title;
		currentUrl = parent.content.document.location.href;
	}
	window.setTimeout("syn();",300);
}

</script>
<script language="JavaScript" src="languages.js"></script>
<link href="style.css" rel="stylesheet" type="text/css">

</head>

<body bgcolor="#DCDBD6" leftmargin="5" topmargin="5" marginwidth="5" marginheight="5" onload="window_load();" onresize="window_resize();">
<form name="form1" method="post" action="">
  <table width="100%" border="0">
    <tr> 
      <td><span class="label"><script>document.write(strings['Topics:']);</script></span><br>
        <select name="Index" size="20" class="label" id="Index" ondblclick="display_click();">
        </select>
         </td>
    </tr>
    <tr>
      <td>        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td align="left"><script>document.write('<input name="Submit" type="submit" class="label" onClick="remove_click(); return false;" value="' + strings['Remove'] + '">');</script></td>
            <td align="right"><script>document.write('<input name="display" type="submit" class="label" id="display" onClick="display_click(); return false;" value="' + strings['Display'] + '">');</script></td>
          </tr>
        </table>  </td>
    </tr>
    <tr> 
      <td> <span class="label"><script>document.write(strings['Current topic:']);</script></span><br>
        <input name="currentTopic" type="text" class="label" id="currentTopic"></td>
    </tr>
    <tr> 
      <td align="right"><script>document.write('<input name="add" type="submit" class="label" id="add" onClick="add_click(); return false;" value="' + strings['Add'] + '">');</script></td>
    </tr>
  </table>

  </form>
</body>
</html>

